package keye.document_manage.dao.sqlserver;

import java.util.HashMap;
import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import keye.document_manage.domain.ArchivenoFormat;
import keye.document_manage.domain.ArchivenoFormatKey;

public interface IArchivenoFormatDao {
    int deleteByPrimaryKey(ArchivenoFormatKey key);

    int insert(ArchivenoFormat record);

    int insertSelective(ArchivenoFormat record);

    ArchivenoFormat selectByPrimaryKey(ArchivenoFormatKey key);

    int updateByPrimaryKeySelective(ArchivenoFormat record);

    int updateByPrimaryKey(ArchivenoFormat record);
    
    @Select("select * from archiveno_format where entity_id=#{entityId}")
    @ResultMap(value = "BaseResultMap")
    List<ArchivenoFormat> selectByEntityId(@Param("entityId") String entityId);
    
    @Select("select * from archiveno_format where entity_id IN (${entityId})")
    @ResultMap(value = "BaseResultMap")
    List<ArchivenoFormat> selectByEntityIds(@Param("entityId") String ids);
    
    @Select("select * from archiveno_format where entity_id=#{entityId}")
    List<HashMap<String, Object>> getAllByEntityId(@Param("entityId") String entityId);
    
    /**
     * 
     * @param entityIds 格式为 'id1','id2','id3','id4' 的字符串
     * @return
     */
    @Select("select * from archiveno_format where entity_id in (${entityId})")
    List<HashMap<String, Object>> getAllByEntityIds(@Param("entityId") String entityIds);
}